<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts: esp8266/hspi.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">ESP8266ILI9341DisplayProject</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_cc2d49507704e901eabd8a82be491fc5.html">esp8266</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">hspi.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="hspi_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="user__config_8h.html">user_config.h</a>&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &lt;stdarg.h&gt;</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &lt;string.h&gt;</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &lt;math.h&gt;</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="hspi_8h.html">hspi.h</a>&quot;</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &quot;gpio.h&quot;</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="comment">// @brief HSPI Prescale value - You should set this in your Makefile</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#ifndef HSPI_PRESCALER</span></div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="hspi_8c.html#ac0b594f74d77f8ac1ee56fd39fcfecdc">   37</a></span>&#160;<span class="preprocessor">#define HSPI_PRESCALER 16</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="hspi_8c.html#a9d8a27ff6d91c4aa89e8719b960d7404">   41</a></span>&#160;<span class="keyword">static</span> <a class="code" href="hspi_8c.html#a9d8a27ff6d91c4aa89e8719b960d7404">_hspi_init_done</a> = 0;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="hspi_8c.html#a13f392bc0f33d99955c2d8ef84f0c583">   44</a></span>&#160;<a class="code" href="send_8c.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> <a class="code" href="hspi_8c.html#a13f392bc0f33d99955c2d8ef84f0c583">hspi_clock</a> = -1;</div><div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="hspi_8h.html#a75c90f17c5ded9cd0515d597533ac517">   55</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="hspi_8c.html#a75c90f17c5ded9cd0515d597533ac517">hspi_init</a>(<a class="code" href="send_8c.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> prescale, <span class="keywordtype">int</span> hwcs)</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;{</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="comment">// FIXME DEBUG </span></div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="preprocessor">#if 1</span></div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="comment">// We only make changes if the speed actually changes</span></div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <span class="keywordflow">if</span>(prescale == <a class="code" href="hspi_8c.html#a13f392bc0f33d99955c2d8ef84f0c583">hspi_clock</a>)</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        <span class="keywordflow">return</span>;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="comment">// If we have been called make sure all spi transactions have finished before </span></div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="comment">// we change anything</span></div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="keywordflow">if</span>(<a class="code" href="hspi_8c.html#a9d8a27ff6d91c4aa89e8719b960d7404">_hspi_init_done</a>)</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;        <a class="code" href="hspi_8c.html#af1a0f7a7dd3cac5dd6b8489f7ff308dc">hspi_waitReady</a>();</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    </div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <span class="comment">/* eagle_soc.h does not define MISO,MOSI,CLK and CS */</span></div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U, 2);    <span class="comment">// HSPIQ MISO GPIO12</span></div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U, 2);    <span class="comment">// HSPID MOSI GPIO13</span></div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTMS_U, 2);    <span class="comment">// CLK        GPIO14</span></div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <span class="comment">// HARDWARE SPI CS</span></div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="keywordflow">if</span>(hwcs)</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;        PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDO_U, 2); <span class="comment">// CS AUTOMATIC ONLY ON GPIO15</span></div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="keywordflow">if</span>(prescale == 0)</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    {</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        WRITE_PERI_REG(PERIPHS_IO_MUX, 0x305); <span class="comment">//set bit9</span></div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;        WRITE_PERI_REG(<a class="code" href="spi__register_8h.html#ac193cd0f592914f5c5632b7f81dcf9d1">SPI_FLASH_CLOCK</a>(<a class="code" href="hspi_8h.html#a22bd615ece7185b5f635eae8facd0994">HSPI</a>), <a class="code" href="spi__register_8h.html#a865aaa3ee4735c6139acdc8a54eca1f2">SPI_CLK_EQU_SYSCLK</a>);</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    }</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <span class="keywordflow">else</span></div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    {</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <span class="comment">// prescale &gt;= 1</span></div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;        WRITE_PERI_REG(PERIPHS_IO_MUX, 0x105);        <span class="comment">//clear bit9</span></div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        WRITE_PERI_REG(<a class="code" href="spi__register_8h.html#ac193cd0f592914f5c5632b7f81dcf9d1">SPI_FLASH_CLOCK</a>(<a class="code" href="hspi_8h.html#a22bd615ece7185b5f635eae8facd0994">HSPI</a>),</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;        (((prescale - 1) &amp; <a class="code" href="spi__register_8h.html#a1b0366fbace7cbdafb476ef11377b4e6">SPI_CLKDIV_PRE</a>) &lt;&lt; <a class="code" href="spi__register_8h.html#ae39144a54ce07c1cf860f366b6235cee">SPI_CLKDIV_PRE_S</a>) |</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        ((1 &amp; <a class="code" href="spi__register_8h.html#ad0a99a332976f6b98318941f76d706a0">SPI_CLKCNT_N</a>) &lt;&lt; <a class="code" href="spi__register_8h.html#a3c3adde4c17e0cb25d458987a20d86b4">SPI_CLKCNT_N_S</a>) |</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        ((0 &amp; <a class="code" href="spi__register_8h.html#aa9feb30cc658107619ff5876aeee0940">SPI_CLKCNT_H</a>) &lt;&lt; <a class="code" href="spi__register_8h.html#ae57220219a50225bbb53f59bdfdc52c8">SPI_CLKCNT_H_S</a>) |</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;        ((1 &amp; <a class="code" href="spi__register_8h.html#a1b14c94f56fad6e9c1f32a64f862e6ac">SPI_CLKCNT_L</a>) &lt;&lt; <a class="code" href="spi__register_8h.html#a1edd73a3e0f94a6edb37e6423a2a91d6">SPI_CLKCNT_L_S</a>));</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    }</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    WRITE_PERI_REG(<a class="code" href="spi__register_8h.html#a48e134b7c110b6cbfee9788f2a814721">SPI_FLASH_CTRL1</a>(<a class="code" href="hspi_8h.html#a22bd615ece7185b5f635eae8facd0994">HSPI</a>), 0);</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <a class="code" href="hspi_8c.html#a13f392bc0f33d99955c2d8ef84f0c583">hspi_clock</a> = prescale;</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <a class="code" href="hspi_8c.html#a9d8a27ff6d91c4aa89e8719b960d7404">_hspi_init_done</a> = 1;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;}</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="hspi_8c.html#a34e8f95d18d9550c20576b48803d6785">  104</a></span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="hspi_8c.html#a34e8f95d18d9550c20576b48803d6785">hspi_config</a>(<span class="keywordtype">int</span> configState)</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;{</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <a class="code" href="send_8c.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> valueOfRegisters = 0;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <a class="code" href="hspi_8c.html#af1a0f7a7dd3cac5dd6b8489f7ff308dc">hspi_waitReady</a>();</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    <span class="keywordflow">if</span> (configState == <a class="code" href="hspi_8h.html#ad9632609fe3a2c77d6bca3d5252980e3">CONFIG_FOR_TX</a>)</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    {</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;        valueOfRegisters |=  <a class="code" href="spi__register_8h.html#a78727df9e0fe66463f3dbc6b4a0747cd">SPI_FLASH_DOUT</a>;</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;<span class="comment">//clear bit 2 see example IoT_Demo</span></div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;        valueOfRegisters &amp;= \</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;            ~(BIT2 | <a class="code" href="spi__register_8h.html#a98938b083f6a99fd4d2e96f078e17033">SPI_FLASH_USR_ADDR</a> | <a class="code" href="spi__register_8h.html#a2c8f31b46808b96ef692b544cf878a49">SPI_FLASH_USR_DUMMY</a> | <a class="code" href="spi__register_8h.html#adbcb0533efc0f9176dee56871fc61213">\</a></div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;<a class="code" href="spi__register_8h.html#adbcb0533efc0f9176dee56871fc61213">            SPI_FLASH_USR_DIN</a> | <a class="code" href="spi__register_8h.html#a7987e30a7f5c000e07d928934aad4d2f">SPI_USR_COMMAND</a> | <a class="code" href="spi__register_8h.html#a4ce55c15793ed51792c2cfe24eae4227">SPI_DOUTDIN</a>);</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    }</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="keywordflow">else</span> <span class="keywordflow">if</span>  (configState == <a class="code" href="hspi_8h.html#a0a89ba717c8b84a7c3799d310b54e5c2">CONFIG_FOR_RX_TX</a>)</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    {</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        valueOfRegisters |=  <a class="code" href="spi__register_8h.html#a78727df9e0fe66463f3dbc6b4a0747cd">SPI_FLASH_DOUT</a> | <a class="code" href="spi__register_8h.html#a4ce55c15793ed51792c2cfe24eae4227">SPI_DOUTDIN</a> | <a class="code" href="spi__register_8h.html#a9ae4e54e59288db516a5959c19116c87">SPI_CK_I_EDGE</a>;</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<span class="comment">//clear bit 2 see example IoT_Demo</span></div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;        valueOfRegisters &amp;= \</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;            ~(BIT2 | <a class="code" href="spi__register_8h.html#a98938b083f6a99fd4d2e96f078e17033">SPI_FLASH_USR_ADDR</a> | <a class="code" href="spi__register_8h.html#a2c8f31b46808b96ef692b544cf878a49">SPI_FLASH_USR_DUMMY</a> | <a class="code" href="spi__register_8h.html#adbcb0533efc0f9176dee56871fc61213">\</a></div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;<a class="code" href="spi__register_8h.html#adbcb0533efc0f9176dee56871fc61213">            SPI_FLASH_USR_DIN</a> | <a class="code" href="spi__register_8h.html#a7987e30a7f5c000e07d928934aad4d2f">SPI_USR_COMMAND</a>);</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    }</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="keywordflow">else</span></div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    {</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        <span class="keywordflow">return</span>;                                   <span class="comment">// Error</span></div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    }</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    WRITE_PERI_REG(<a class="code" href="spi__register_8h.html#a07e49dccefac8a1009ecbfa96e3758eb">SPI_FLASH_USER</a>(<a class="code" href="hspi_8h.html#a22bd615ece7185b5f635eae8facd0994">HSPI</a>), valueOfRegisters);</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;}</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;<span class="comment">// Only called from hspi_writeFIFO or hspi_readFIFO</span></div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;<span class="comment">// So bounds testing has already been done</span></div><div class="line"><a name="l00140"></a><span class="lineno"><a class="line" href="hspi_8c.html#aa699c6593cc1ccd0e1b972bab7b527d9">  140</a></span>&#160;<span class="comment"></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="hspi_8c.html#aa699c6593cc1ccd0e1b972bab7b527d9">hspi_setBits</a>(<a class="code" href="send_8c.html#a273cf69d639a59973b6019625df33e30">uint16_t</a> bytes)</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;{</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    <a class="code" href="send_8c.html#a273cf69d639a59973b6019625df33e30">uint16_t</a> bits = (bytes &lt;&lt; 3) - 1;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    WRITE_PERI_REG(<a class="code" href="spi__register_8h.html#a41fe427479b2f4e5b97549034e9d6425">SPI_FLASH_USER1</a>(<a class="code" href="hspi_8h.html#a22bd615ece7185b5f635eae8facd0994">HSPI</a>),</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;        ( (bits &amp; <a class="code" href="spi__register_8h.html#a2a52c366cf9b24b19233cdaffbbce4a4">SPI_USR_OUT_BITLEN</a>) &lt;&lt; <a class="code" href="spi__register_8h.html#a64c25e5ab9c68bbd6f4714556eb5e330">SPI_USR_OUT_BITLEN_S</a> ) |</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;        ( (bits &amp; <a class="code" href="spi__register_8h.html#a18df12172ff907fe172200447d5fad9c">SPI_USR_DIN_BITLEN</a>) &lt;&lt; <a class="code" href="spi__register_8h.html#a3ad62dc9ccd056ca416114564ff1e0b2">SPI_USR_DIN_BITLEN_S</a> ) );</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;}</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;</div><div class="line"><a name="l00151"></a><span class="lineno"><a class="line" href="hspi_8c.html#a16038c164ad4e103feeddafe6bdce825">  151</a></span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="hspi_8c.html#a16038c164ad4e103feeddafe6bdce825">hspi_startSend</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;{</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    SET_PERI_REG_MASK(<a class="code" href="spi__register_8h.html#af102aefcd36fbd7f60de993e4fd401b3">SPI_FLASH_CMD</a>(<a class="code" href="hspi_8h.html#a22bd615ece7185b5f635eae8facd0994">HSPI</a>), <a class="code" href="spi__register_8h.html#a0c028b3167170432c7b420d3d2ef0625">SPI_FLASH_USR</a>);</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;}</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno"><a class="line" href="hspi_8h.html#af1a0f7a7dd3cac5dd6b8489f7ff308dc">  159</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="hspi_8c.html#af1a0f7a7dd3cac5dd6b8489f7ff308dc">hspi_waitReady</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;{</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    <span class="keywordflow">while</span> (READ_PERI_REG(<a class="code" href="spi__register_8h.html#af102aefcd36fbd7f60de993e4fd401b3">SPI_FLASH_CMD</a>(<a class="code" href="hspi_8h.html#a22bd615ece7185b5f635eae8facd0994">HSPI</a>)) &amp; <a class="code" href="spi__register_8h.html#a0c028b3167170432c7b420d3d2ef0625">SPI_FLASH_USR</a>) {};</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;}</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;</div><div class="line"><a name="l00169"></a><span class="lineno"><a class="line" href="hspi_8c.html#afc6137e3acc101f92a9502ad207f0b4d">  169</a></span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="hspi_8c.html#afc6137e3acc101f92a9502ad207f0b4d">hspi_writeFIFO</a>(<a class="code" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *write_data, <span class="keywordtype">int</span> bytes)</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;{</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    <a class="code" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> word_ind = 0;</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    <span class="keywordflow">if</span>(bytes &gt; <a class="code" href="hspi_8h.html#a1eaecab4a7e4f328f38ce57d4d3012d1">HSPI_FIFO_SIZE</a>)                    <span class="comment">// TODO set error status</span></div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;        <span class="keywordflow">return</span>;</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    <a class="code" href="hspi_8c.html#aa699c6593cc1ccd0e1b972bab7b527d9">hspi_setBits</a>(bytes);                          <span class="comment">// Update FIFO with number of bits we will send</span></div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;<span class="comment">// First do a fast write with 32 bit chunks at a time</span></div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    <span class="keywordflow">while</span>(bytes &gt;= 4)</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    {</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;<span class="comment">// Cast both source and destination to 4 byte word pointers</span></div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;        ((<a class="code" href="send_8c.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> *)<a class="code" href="spi__register_8h.html#a985ecc8150c9d2a866a274959872053f">SPI_FLASH_C0</a>(<a class="code" href="hspi_8h.html#a22bd615ece7185b5f635eae8facd0994">HSPI</a>)) [word_ind] = \</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;            ((<a class="code" href="send_8c.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> *)write_data) [word_ind];</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;        bytes -= 4;</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;        word_ind++;</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    }</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;<span class="comment">// Next write remaining bytes (if any) to FIFO as a single word</span></div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;<span class="comment">// Note: We follow the good practice of avoiding access past the end of an array.</span></div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;<span class="comment">//  (ie. protected memory, PIC using retw from flash ... could crash some CPU&#39;s)</span></div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    <span class="keywordflow">if</span>(bytes)                                     <span class="comment">// Valid counts are now: 3,2,1 bytes</span></div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    {</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;        <a class="code" href="send_8c.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> last_word = 0;                   <span class="comment">// Last word to send</span></div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;        <a class="code" href="send_8c.html#a273cf69d639a59973b6019625df33e30">uint16_t</a> byte_ind = word_ind &lt;&lt; 2;        <span class="comment">// Convert to Byte index</span></div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;<span class="comment">// Working MSB to LSB allows assigment to LSB without shifting</span></div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;<span class="comment">// Compiler can optimize powers of 8 into byte swaps, etc... (on some CPU&#39;s)</span></div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;        <span class="keywordflow">while</span>(bytes--)                            <span class="comment">// index is now 2,1,0 matching required storage offset</span></div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;        {</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;            last_word &lt;&lt;= 8;</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;<span class="comment">// 2,1,0</span></div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;            last_word |= ((<a class="code" href="send_8c.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a>) 0xffU &amp; write_data[byte_ind + bytes ]);</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;        }</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;<span class="comment">// Send last partial word</span></div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;        ((<a class="code" href="send_8c.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> *)<a class="code" href="spi__register_8h.html#a985ecc8150c9d2a866a274959872053f">SPI_FLASH_C0</a>(<a class="code" href="hspi_8h.html#a22bd615ece7185b5f635eae8facd0994">HSPI</a>)) [word_ind] = last_word;</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;    }</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;}</div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;</div><div class="line"><a name="l00215"></a><span class="lineno"><a class="line" href="hspi_8c.html#a50884c24ab0b495b0c0112547ecde051">  215</a></span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="hspi_8c.html#a50884c24ab0b495b0c0112547ecde051">hspi_readFIFO</a>(<a class="code" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *read_data, <span class="keywordtype">int</span> bytes)</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;{</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;    <a class="code" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> word_ind = 0;</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;    <span class="keywordflow">if</span>(bytes &gt; <a class="code" href="hspi_8h.html#a1eaecab4a7e4f328f38ce57d4d3012d1">HSPI_FIFO_SIZE</a>)                    <span class="comment">// TODO set error status</span></div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;        <span class="keywordflow">return</span>;</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;</div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;<span class="comment">// Update FIFO with number of bits to read ?</span></div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;    <a class="code" href="hspi_8c.html#aa699c6593cc1ccd0e1b972bab7b527d9">hspi_setBits</a>(bytes);</div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;</div><div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;<span class="comment">// First do a fast read 32 bit chunks at a time</span></div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;    <span class="keywordflow">while</span>(bytes &gt;= 4)</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;    {</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;<span class="comment">// Cast both source and destination to 4 byte word pointers</span></div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;        ((<a class="code" href="send_8c.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> *)read_data) [word_ind] = \</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;            ((<a class="code" href="send_8c.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> *)<a class="code" href="spi__register_8h.html#a985ecc8150c9d2a866a274959872053f">SPI_FLASH_C0</a>(<a class="code" href="hspi_8h.html#a22bd615ece7185b5f635eae8facd0994">HSPI</a>)) [word_ind];</div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;        bytes -= 4;</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;        word_ind++;</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;    }</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;<span class="comment">// Next read remaining bytes (if any) from FIFO as a single word</span></div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;<span class="comment">// Note: We follow the good practice of avoiding access past the end of an array.</span></div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;<span class="comment">//  (ie. protected memory, PIC using retw from flash ... could crash some CPU&#39;s)</span></div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;    <span class="keywordflow">if</span>(bytes)                                     <span class="comment">// Valid counts are now: 3,2,1 bytes</span></div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    {</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;        <a class="code" href="send_8c.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> last_word = ((<a class="code" href="send_8c.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> *)<a class="code" href="spi__register_8h.html#a985ecc8150c9d2a866a274959872053f">SPI_FLASH_C0</a>(<a class="code" href="hspi_8h.html#a22bd615ece7185b5f635eae8facd0994">HSPI</a>)) [word_ind];</div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;        <a class="code" href="send_8c.html#a273cf69d639a59973b6019625df33e30">uint16_t</a> byte_ind = word_ind &lt;&lt; 2;        <span class="comment">// Convert to Byte index</span></div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;        <span class="keywordflow">while</span>(bytes--)                            <span class="comment">// index is now 2,1,0 matching required storage offset</span></div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;        {</div><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;<span class="comment">// 2,1,0 order</span></div><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;            read_data[byte_ind++] = (<a class="code" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>) 0xff &amp; last_word;</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;            last_word &gt;&gt;= 8;</div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;        }</div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;<span class="comment">// Send last partial word</span></div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;    }</div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;}</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;</div><div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;</div><div class="line"><a name="l00265"></a><span class="lineno"><a class="line" href="hspi_8h.html#a95e93b2eb7fb8bd8548f2ad9022aac58">  265</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="hspi_8c.html#a95e93b2eb7fb8bd8548f2ad9022aac58">hspi_TX</a>(<a class="code" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *data, <span class="keywordtype">int</span> count)</div><div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;{</div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;    <span class="keywordtype">int</span> bytes;</div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;</div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;    <span class="keywordflow">while</span>(count &gt; 0)</div><div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;    {</div><div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;        <span class="comment">// we will never have zero - we already checked</span></div><div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;        bytes = count;</div><div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;        <span class="keywordflow">if</span>(bytes &gt; <a class="code" href="hspi_8h.html#a1eaecab4a7e4f328f38ce57d4d3012d1">HSPI_FIFO_SIZE</a>)</div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;            bytes = <a class="code" href="hspi_8h.html#a1eaecab4a7e4f328f38ce57d4d3012d1">HSPI_FIFO_SIZE</a>;</div><div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;</div><div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;        <a class="code" href="hspi_8c.html#a34e8f95d18d9550c20576b48803d6785">hspi_config</a>(<a class="code" href="hspi_8h.html#ad9632609fe3a2c77d6bca3d5252980e3">CONFIG_FOR_TX</a>);   <span class="comment">// Does hspi_waitReady(); first</span></div><div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;        <span class="comment">// clear buffer first</span></div><div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;        <a class="code" href="hspi_8c.html#afc6137e3acc101f92a9502ad207f0b4d">hspi_writeFIFO</a>(data, bytes);</div><div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;        <a class="code" href="hspi_8c.html#a16038c164ad4e103feeddafe6bdce825">hspi_startSend</a>();</div><div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;        <a class="code" href="hspi_8c.html#af1a0f7a7dd3cac5dd6b8489f7ff308dc">hspi_waitReady</a>();</div><div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;</div><div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;        data += bytes;</div><div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;        count -= bytes;</div><div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;    }</div><div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;}</div><div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;</div><div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;</div><div class="line"><a name="l00292"></a><span class="lineno"><a class="line" href="hspi_8h.html#a1ea1bd90994ac123b4c62bfa511b6972">  292</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="hspi_8c.html#a1ea1bd90994ac123b4c62bfa511b6972">hspi_TXRX</a>(<a class="code" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *data, <span class="keywordtype">int</span> count)</div><div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;{</div><div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;    <span class="keywordtype">int</span> bytes;</div><div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;</div><div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;    <span class="keywordflow">while</span>(count &gt; 0)</div><div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;    {</div><div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;        <span class="comment">// we will never have zero - we already checked</span></div><div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;        bytes = count;</div><div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;        <span class="keywordflow">if</span>(bytes &gt; <a class="code" href="hspi_8h.html#a1eaecab4a7e4f328f38ce57d4d3012d1">HSPI_FIFO_SIZE</a>)</div><div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;            bytes = <a class="code" href="hspi_8h.html#a1eaecab4a7e4f328f38ce57d4d3012d1">HSPI_FIFO_SIZE</a>;</div><div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;</div><div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;        <a class="code" href="hspi_8c.html#a34e8f95d18d9550c20576b48803d6785">hspi_config</a>(<a class="code" href="hspi_8h.html#a0a89ba717c8b84a7c3799d310b54e5c2">CONFIG_FOR_RX_TX</a>);   <span class="comment">// Does hspi_waitReady(); first</span></div><div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;        <a class="code" href="hspi_8c.html#afc6137e3acc101f92a9502ad207f0b4d">hspi_writeFIFO</a>(data, bytes);</div><div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;        <a class="code" href="hspi_8c.html#a16038c164ad4e103feeddafe6bdce825">hspi_startSend</a>();</div><div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;        <a class="code" href="hspi_8c.html#af1a0f7a7dd3cac5dd6b8489f7ff308dc">hspi_waitReady</a>();</div><div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;        <a class="code" href="hspi_8c.html#a50884c24ab0b495b0c0112547ecde051">hspi_readFIFO</a>(data, bytes);</div><div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;</div><div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;        data += bytes;</div><div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;        count -= bytes;</div><div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;    }</div><div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;}</div><div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;</div><div class="line"><a name="l00318"></a><span class="lineno"><a class="line" href="hspi_8h.html#a0603c3e5a8c6c29e5deb5609b28e86bc">  318</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="hspi_8c.html#a0603c3e5a8c6c29e5deb5609b28e86bc">hspi_RX</a>(<a class="code" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *data, <span class="keywordtype">int</span> count)</div><div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;{</div><div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;    <span class="keywordtype">int</span> bytes;</div><div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;</div><div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;    <span class="keywordflow">while</span>(count &gt; 0)</div><div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;    {</div><div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;        <span class="comment">// we will never have zero - we already checked</span></div><div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;        bytes = count;</div><div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;        <span class="keywordflow">if</span>(bytes &gt; <a class="code" href="hspi_8h.html#a1eaecab4a7e4f328f38ce57d4d3012d1">HSPI_FIFO_SIZE</a>)</div><div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;            bytes = <a class="code" href="hspi_8h.html#a1eaecab4a7e4f328f38ce57d4d3012d1">HSPI_FIFO_SIZE</a>;</div><div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;</div><div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;        <span class="comment">// discard TX data</span></div><div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;        <a class="code" href="hspi_8c.html#a34e8f95d18d9550c20576b48803d6785">hspi_config</a>(<a class="code" href="hspi_8h.html#a0a89ba717c8b84a7c3799d310b54e5c2">CONFIG_FOR_RX_TX</a>);   </div><div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;        <span class="comment">// Writes are ignored, so we set data to 0xff</span></div><div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;        memset(data, 0xff, bytes);</div><div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;        <a class="code" href="hspi_8c.html#afc6137e3acc101f92a9502ad207f0b4d">hspi_writeFIFO</a>(data, bytes);</div><div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;        <a class="code" href="hspi_8c.html#a16038c164ad4e103feeddafe6bdce825">hspi_startSend</a>();</div><div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;        <a class="code" href="hspi_8c.html#af1a0f7a7dd3cac5dd6b8489f7ff308dc">hspi_waitReady</a>();</div><div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;        <span class="comment">// read result</span></div><div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;        <a class="code" href="hspi_8c.html#a50884c24ab0b495b0c0112547ecde051">hspi_readFIFO</a>(data, bytes);</div><div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;</div><div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;        data += bytes;</div><div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;        count -= bytes;</div><div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;    }</div><div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;}</div><div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;</div><div class="ttc" id="spi__register_8h_html_a985ecc8150c9d2a866a274959872053f"><div class="ttname"><a href="spi__register_8h.html#a985ecc8150c9d2a866a274959872053f">SPI_FLASH_C0</a></div><div class="ttdeci">#define SPI_FLASH_C0(i)</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00209">spi_register.h:209</a></div></div>
<div class="ttc" id="spi__register_8h_html_a4ce55c15793ed51792c2cfe24eae4227"><div class="ttname"><a href="spi__register_8h.html#a4ce55c15793ed51792c2cfe24eae4227">SPI_DOUTDIN</a></div><div class="ttdeci">#define SPI_DOUTDIN</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00131">spi_register.h:131</a></div></div>
<div class="ttc" id="hspi_8c_html_a0603c3e5a8c6c29e5deb5609b28e86bc"><div class="ttname"><a href="hspi_8c.html#a0603c3e5a8c6c29e5deb5609b28e86bc">hspi_RX</a></div><div class="ttdeci">void hspi_RX(uint8_t *data, int count)</div><div class="ttdoc">HSPI read using FIFO. </div><div class="ttdef"><b>Definition:</b> <a href="hspi_8c_source.html#l00318">hspi.c:318</a></div></div>
<div class="ttc" id="send_8c_html_a273cf69d639a59973b6019625df33e30"><div class="ttname"><a href="send_8c.html#a273cf69d639a59973b6019625df33e30">uint16_t</a></div><div class="ttdeci">unsigned short uint16_t</div><div class="ttdef"><b>Definition:</b> <a href="send_8c_source.html#l00018">send.c:18</a></div></div>
<div class="ttc" id="spi__register_8h_html_ae39144a54ce07c1cf860f366b6235cee"><div class="ttname"><a href="spi__register_8h.html#ae39144a54ce07c1cf860f366b6235cee">SPI_CLKDIV_PRE_S</a></div><div class="ttdeci">#define SPI_CLKDIV_PRE_S</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00092">spi_register.h:92</a></div></div>
<div class="ttc" id="user__config_8h_html"><div class="ttname"><a href="user__config_8h.html">user_config.h</a></div><div class="ttdoc">Master include file for project Includes all project includes and defines here. </div></div>
<div class="ttc" id="spi__register_8h_html_a3ad62dc9ccd056ca416114564ff1e0b2"><div class="ttname"><a href="spi__register_8h.html#a3ad62dc9ccd056ca416114564ff1e0b2">SPI_USR_DIN_BITLEN_S</a></div><div class="ttdeci">#define SPI_USR_DIN_BITLEN_S</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00139">spi_register.h:139</a></div></div>
<div class="ttc" id="hspi_8c_html_a75c90f17c5ded9cd0515d597533ac517"><div class="ttname"><a href="hspi_8c.html#a75c90f17c5ded9cd0515d597533ac517">hspi_init</a></div><div class="ttdeci">void hspi_init(uint32_t prescale, int hwcs)</div><div class="ttdoc">HSPI Initiaization - with automatic chip select Pins: MISO GPIO12 MOSI GPIO13 CLK GPIO14 CS GPIO15 - ...</div><div class="ttdef"><b>Definition:</b> <a href="hspi_8c_source.html#l00055">hspi.c:55</a></div></div>
<div class="ttc" id="spi__register_8h_html_a1b14c94f56fad6e9c1f32a64f862e6ac"><div class="ttname"><a href="spi__register_8h.html#a1b14c94f56fad6e9c1f32a64f862e6ac">SPI_CLKCNT_L</a></div><div class="ttdeci">#define SPI_CLKCNT_L</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00097">spi_register.h:97</a></div></div>
<div class="ttc" id="spi__register_8h_html_a48e134b7c110b6cbfee9788f2a814721"><div class="ttname"><a href="spi__register_8h.html#a48e134b7c110b6cbfee9788f2a814721">SPI_FLASH_CTRL1</a></div><div class="ttdeci">#define SPI_FLASH_CTRL1(i)</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00046">spi_register.h:46</a></div></div>
<div class="ttc" id="hspi_8c_html_a16038c164ad4e103feeddafe6bdce825"><div class="ttname"><a href="hspi_8c.html#a16038c164ad4e103feeddafe6bdce825">hspi_startSend</a></div><div class="ttdeci">static void hspi_startSend(void)</div><div class="ttdoc">HSPI Start Send. </div><div class="ttdef"><b>Definition:</b> <a href="hspi_8c_source.html#l00151">hspi.c:151</a></div></div>
<div class="ttc" id="spi__register_8h_html_a18df12172ff907fe172200447d5fad9c"><div class="ttname"><a href="spi__register_8h.html#a18df12172ff907fe172200447d5fad9c">SPI_USR_DIN_BITLEN</a></div><div class="ttdeci">#define SPI_USR_DIN_BITLEN</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00138">spi_register.h:138</a></div></div>
<div class="ttc" id="spi__register_8h_html_a9ae4e54e59288db516a5959c19116c87"><div class="ttname"><a href="spi__register_8h.html#a9ae4e54e59288db516a5959c19116c87">SPI_CK_I_EDGE</a></div><div class="ttdeci">#define SPI_CK_I_EDGE</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00126">spi_register.h:126</a></div></div>
<div class="ttc" id="hspi_8h_html_a0a89ba717c8b84a7c3799d310b54e5c2"><div class="ttname"><a href="hspi_8h.html#a0a89ba717c8b84a7c3799d310b54e5c2">CONFIG_FOR_RX_TX</a></div><div class="ttdeci">#define CONFIG_FOR_RX_TX</div><div class="ttdef"><b>Definition:</b> <a href="hspi_8h_source.html#l00016">hspi.h:16</a></div></div>
<div class="ttc" id="send_8c_html_a435d1572bf3f880d55459d9805097f62"><div class="ttname"><a href="send_8c.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a></div><div class="ttdeci">unsigned int uint32_t</div><div class="ttdef"><b>Definition:</b> <a href="send_8c_source.html#l00019">send.c:19</a></div></div>
<div class="ttc" id="hspi_8h_html_a1eaecab4a7e4f328f38ce57d4d3012d1"><div class="ttname"><a href="hspi_8h.html#a1eaecab4a7e4f328f38ce57d4d3012d1">HSPI_FIFO_SIZE</a></div><div class="ttdeci">#define HSPI_FIFO_SIZE</div><div class="ttdef"><b>Definition:</b> <a href="hspi_8h_source.html#l00013">hspi.h:13</a></div></div>
<div class="ttc" id="spi__register_8h_html_a3c3adde4c17e0cb25d458987a20d86b4"><div class="ttname"><a href="spi__register_8h.html#a3c3adde4c17e0cb25d458987a20d86b4">SPI_CLKCNT_N_S</a></div><div class="ttdeci">#define SPI_CLKCNT_N_S</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00094">spi_register.h:94</a></div></div>
<div class="ttc" id="spi__register_8h_html_af102aefcd36fbd7f60de993e4fd401b3"><div class="ttname"><a href="spi__register_8h.html#af102aefcd36fbd7f60de993e4fd401b3">SPI_FLASH_CMD</a></div><div class="ttdeci">#define SPI_FLASH_CMD(i)</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00012">spi_register.h:12</a></div></div>
<div class="ttc" id="spi__register_8h_html_a865aaa3ee4735c6139acdc8a54eca1f2"><div class="ttname"><a href="spi__register_8h.html#a865aaa3ee4735c6139acdc8a54eca1f2">SPI_CLK_EQU_SYSCLK</a></div><div class="ttdeci">#define SPI_CLK_EQU_SYSCLK</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00090">spi_register.h:90</a></div></div>
<div class="ttc" id="spi__register_8h_html_a98938b083f6a99fd4d2e96f078e17033"><div class="ttname"><a href="spi__register_8h.html#a98938b083f6a99fd4d2e96f078e17033">SPI_FLASH_USR_ADDR</a></div><div class="ttdeci">#define SPI_FLASH_USR_ADDR</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00102">spi_register.h:102</a></div></div>
<div class="ttc" id="spi__register_8h_html_a78727df9e0fe66463f3dbc6b4a0747cd"><div class="ttname"><a href="spi__register_8h.html#a78727df9e0fe66463f3dbc6b4a0747cd">SPI_FLASH_DOUT</a></div><div class="ttdeci">#define SPI_FLASH_DOUT</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00105">spi_register.h:105</a></div></div>
<div class="ttc" id="spi__register_8h_html_ac193cd0f592914f5c5632b7f81dcf9d1"><div class="ttname"><a href="spi__register_8h.html#ac193cd0f592914f5c5632b7f81dcf9d1">SPI_FLASH_CLOCK</a></div><div class="ttdeci">#define SPI_FLASH_CLOCK(i)</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00089">spi_register.h:89</a></div></div>
<div class="ttc" id="hspi_8c_html_af1a0f7a7dd3cac5dd6b8489f7ff308dc"><div class="ttname"><a href="hspi_8c.html#af1a0f7a7dd3cac5dd6b8489f7ff308dc">hspi_waitReady</a></div><div class="ttdeci">void hspi_waitReady(void)</div><div class="ttdoc">HSPI Ready wait. </div><div class="ttdef"><b>Definition:</b> <a href="hspi_8c_source.html#l00159">hspi.c:159</a></div></div>
<div class="ttc" id="spi__register_8h_html_a2c8f31b46808b96ef692b544cf878a49"><div class="ttname"><a href="spi__register_8h.html#a2c8f31b46808b96ef692b544cf878a49">SPI_FLASH_USR_DUMMY</a></div><div class="ttdeci">#define SPI_FLASH_USR_DUMMY</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00103">spi_register.h:103</a></div></div>
<div class="ttc" id="hspi_8c_html_a95e93b2eb7fb8bd8548f2ad9022aac58"><div class="ttname"><a href="hspi_8c.html#a95e93b2eb7fb8bd8548f2ad9022aac58">hspi_TX</a></div><div class="ttdeci">void hspi_TX(uint8_t *data, int count)</div><div class="ttdoc">SPI buffered write functions. </div><div class="ttdef"><b>Definition:</b> <a href="hspi_8c_source.html#l00265">hspi.c:265</a></div></div>
<div class="ttc" id="spi__register_8h_html_ad0a99a332976f6b98318941f76d706a0"><div class="ttname"><a href="spi__register_8h.html#ad0a99a332976f6b98318941f76d706a0">SPI_CLKCNT_N</a></div><div class="ttdeci">#define SPI_CLKCNT_N</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00093">spi_register.h:93</a></div></div>
<div class="ttc" id="spi__register_8h_html_a41fe427479b2f4e5b97549034e9d6425"><div class="ttname"><a href="spi__register_8h.html#a41fe427479b2f4e5b97549034e9d6425">SPI_FLASH_USER1</a></div><div class="ttdeci">#define SPI_FLASH_USER1(i)</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00133">spi_register.h:133</a></div></div>
<div class="ttc" id="spi__register_8h_html_ae57220219a50225bbb53f59bdfdc52c8"><div class="ttname"><a href="spi__register_8h.html#ae57220219a50225bbb53f59bdfdc52c8">SPI_CLKCNT_H_S</a></div><div class="ttdeci">#define SPI_CLKCNT_H_S</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00096">spi_register.h:96</a></div></div>
<div class="ttc" id="hspi_8c_html_a50884c24ab0b495b0c0112547ecde051"><div class="ttname"><a href="hspi_8c.html#a50884c24ab0b495b0c0112547ecde051">hspi_readFIFO</a></div><div class="ttdeci">static void hspi_readFIFO(uint8_t *read_data, int bytes)</div><div class="ttdoc">HSPI FIFO Read in units of 32 bits (4 byte words) </div><div class="ttdef"><b>Definition:</b> <a href="hspi_8c_source.html#l00215">hspi.c:215</a></div></div>
<div class="ttc" id="spi__register_8h_html_a7987e30a7f5c000e07d928934aad4d2f"><div class="ttname"><a href="spi__register_8h.html#a7987e30a7f5c000e07d928934aad4d2f">SPI_USR_COMMAND</a></div><div class="ttdeci">#define SPI_USR_COMMAND</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00101">spi_register.h:101</a></div></div>
<div class="ttc" id="spi__register_8h_html_a07e49dccefac8a1009ecbfa96e3758eb"><div class="ttname"><a href="spi__register_8h.html#a07e49dccefac8a1009ecbfa96e3758eb">SPI_FLASH_USER</a></div><div class="ttdeci">#define SPI_FLASH_USER(i)</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00100">spi_register.h:100</a></div></div>
<div class="ttc" id="spi__register_8h_html_a0c028b3167170432c7b420d3d2ef0625"><div class="ttname"><a href="spi__register_8h.html#a0c028b3167170432c7b420d3d2ef0625">SPI_FLASH_USR</a></div><div class="ttdeci">#define SPI_FLASH_USR</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00026">spi_register.h:26</a></div></div>
<div class="ttc" id="hspi_8h_html_ad9632609fe3a2c77d6bca3d5252980e3"><div class="ttname"><a href="hspi_8h.html#ad9632609fe3a2c77d6bca3d5252980e3">CONFIG_FOR_TX</a></div><div class="ttdeci">#define CONFIG_FOR_TX</div><div class="ttdef"><b>Definition:</b> <a href="hspi_8h_source.html#l00015">hspi.h:15</a></div></div>
<div class="ttc" id="hspi_8c_html_afc6137e3acc101f92a9502ad207f0b4d"><div class="ttname"><a href="hspi_8c.html#afc6137e3acc101f92a9502ad207f0b4d">hspi_writeFIFO</a></div><div class="ttdeci">static void hspi_writeFIFO(uint8_t *write_data, int bytes)</div><div class="ttdoc">HSPI FIFO write in units of 32 bits (4 byte words) </div><div class="ttdef"><b>Definition:</b> <a href="hspi_8c_source.html#l00169">hspi.c:169</a></div></div>
<div class="ttc" id="hspi_8c_html_a9d8a27ff6d91c4aa89e8719b960d7404"><div class="ttname"><a href="hspi_8c.html#a9d8a27ff6d91c4aa89e8719b960d7404">_hspi_init_done</a></div><div class="ttdeci">static _hspi_init_done</div><div class="ttdef"><b>Definition:</b> <a href="hspi_8c_source.html#l00041">hspi.c:41</a></div></div>
<div class="ttc" id="spi__register_8h_html_adbcb0533efc0f9176dee56871fc61213"><div class="ttname"><a href="spi__register_8h.html#adbcb0533efc0f9176dee56871fc61213">SPI_FLASH_USR_DIN</a></div><div class="ttdeci">#define SPI_FLASH_USR_DIN</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00104">spi_register.h:104</a></div></div>
<div class="ttc" id="spi__register_8h_html_a64c25e5ab9c68bbd6f4714556eb5e330"><div class="ttname"><a href="spi__register_8h.html#a64c25e5ab9c68bbd6f4714556eb5e330">SPI_USR_OUT_BITLEN_S</a></div><div class="ttdeci">#define SPI_USR_OUT_BITLEN_S</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00137">spi_register.h:137</a></div></div>
<div class="ttc" id="hspi_8h_html_a22bd615ece7185b5f635eae8facd0994"><div class="ttname"><a href="hspi_8h.html#a22bd615ece7185b5f635eae8facd0994">HSPI</a></div><div class="ttdeci">#define HSPI</div><div class="ttdef"><b>Definition:</b> <a href="hspi_8h_source.html#l00012">hspi.h:12</a></div></div>
<div class="ttc" id="hspi_8h_html"><div class="ttname"><a href="hspi_8h.html">hspi.h</a></div></div>
<div class="ttc" id="spi__register_8h_html_a1b0366fbace7cbdafb476ef11377b4e6"><div class="ttname"><a href="spi__register_8h.html#a1b0366fbace7cbdafb476ef11377b4e6">SPI_CLKDIV_PRE</a></div><div class="ttdeci">#define SPI_CLKDIV_PRE</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00091">spi_register.h:91</a></div></div>
<div class="ttc" id="spi__register_8h_html_aa9feb30cc658107619ff5876aeee0940"><div class="ttname"><a href="spi__register_8h.html#aa9feb30cc658107619ff5876aeee0940">SPI_CLKCNT_H</a></div><div class="ttdeci">#define SPI_CLKCNT_H</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00095">spi_register.h:95</a></div></div>
<div class="ttc" id="spi__register_8h_html_a2a52c366cf9b24b19233cdaffbbce4a4"><div class="ttname"><a href="spi__register_8h.html#a2a52c366cf9b24b19233cdaffbbce4a4">SPI_USR_OUT_BITLEN</a></div><div class="ttdeci">#define SPI_USR_OUT_BITLEN</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00136">spi_register.h:136</a></div></div>
<div class="ttc" id="hspi_8c_html_aa699c6593cc1ccd0e1b972bab7b527d9"><div class="ttname"><a href="hspi_8c.html#aa699c6593cc1ccd0e1b972bab7b527d9">hspi_setBits</a></div><div class="ttdeci">static void hspi_setBits(uint16_t bytes)</div><div class="ttdoc">HSPI FIFO send or receive byte count. </div><div class="ttdef"><b>Definition:</b> <a href="hspi_8c_source.html#l00140">hspi.c:140</a></div></div>
<div class="ttc" id="hspi_8c_html_a34e8f95d18d9550c20576b48803d6785"><div class="ttname"><a href="hspi_8c.html#a34e8f95d18d9550c20576b48803d6785">hspi_config</a></div><div class="ttdeci">static void hspi_config(int configState)</div><div class="ttdoc">HSPI Configuration for tranasmit and receive. </div><div class="ttdef"><b>Definition:</b> <a href="hspi_8c_source.html#l00104">hspi.c:104</a></div></div>
<div class="ttc" id="send_8c_html_aba7bc1797add20fe3efdf37ced1182c5"><div class="ttname"><a href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a></div><div class="ttdeci">unsigned char uint8_t</div><div class="ttdef"><b>Definition:</b> <a href="send_8c_source.html#l00017">send.c:17</a></div></div>
<div class="ttc" id="spi__register_8h_html_a1edd73a3e0f94a6edb37e6423a2a91d6"><div class="ttname"><a href="spi__register_8h.html#a1edd73a3e0f94a6edb37e6423a2a91d6">SPI_CLKCNT_L_S</a></div><div class="ttdeci">#define SPI_CLKCNT_L_S</div><div class="ttdef"><b>Definition:</b> <a href="spi__register_8h_source.html#l00098">spi_register.h:98</a></div></div>
<div class="ttc" id="hspi_8c_html_a1ea1bd90994ac123b4c62bfa511b6972"><div class="ttname"><a href="hspi_8c.html#a1ea1bd90994ac123b4c62bfa511b6972">hspi_TXRX</a></div><div class="ttdeci">void hspi_TXRX(uint8_t *data, int count)</div><div class="ttdoc">HSPI write and read using FIFO. </div><div class="ttdef"><b>Definition:</b> <a href="hspi_8c_source.html#l00292">hspi.c:292</a></div></div>
<div class="ttc" id="hspi_8c_html_a13f392bc0f33d99955c2d8ef84f0c583"><div class="ttname"><a href="hspi_8c.html#a13f392bc0f33d99955c2d8ef84f0c583">hspi_clock</a></div><div class="ttdeci">uint32_t hspi_clock</div><div class="ttdoc">hspi clock cached value </div><div class="ttdef"><b>Definition:</b> <a href="hspi_8c_source.html#l00044">hspi.c:44</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 31 2018 21:22:16 for ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
